if(typeof Base == 'undefined') {
	var Base = {};
}
Base = {
	"fileUrlPath": "http://125.71.203.198:8082/",   //banber图片地址 
	//"serverPath": "http://192.168.10.248/"
	"serverPath": "http://125.71.203.198/",
	//"serverPath": "http://localhost:8088/yhsite/"
}
Base.fujianPath = Base.fileUrlPath + "ec/fujian/";
/**
 * 接口对象，地址列表;
 */
Base.urlPath = {
	"ad": "app/site/ad.html",  //广告查询
	"articlelist": "app/site/article.html",          //文章列表
	"articlecatebyid": "app/site/articlecatebyid.html",        //文章分类
	"articleandmore": "app/site/articleandmore.html",  //文章列表（带内容）
	"articledetail": "app/site/articledetail.html"          //文章详情
}

/**
 * 请求服务
 * @method requestServer 
 * @param {String} urlType 根据类型取得服务器地址 必选
 * @param {String} data 请求参数对象  必选可为null， 
 * @param {String} callback 回调方法  可选
 * @param {Boolean} mask 是否显示蒙层 可选 默认false
 * @param {String} type 请求方式:post,get 可选  默认post
 */
Base.requestServer = function (urlType, data, callback, mask, type) {
	urlType = $.trim(urlType);
	var url = ""; 
	if(urlType.indexOf("http://") != -1) {
		url = urlType;
	} else {
		url = Base.serverPath + Base.urlPath[urlType]
	}
	data = data || {};
	type = type || "post";
	/*if($.isObject(data)) {
		data["access_token"] = $.getStorage("access_token");
	}
	if($.isArray(data)) {
		data.push({"name": "access_token", "value": $.getStorage("access_token")});
	}*/
	if(mask) {
		$.showGifMask();
	} 
	var ajax = $.ajax({
        type: type,
        url: url,
        data: data,
        success: function(data) {
        	$.removeGifMask();
        	data = eval("("+ data +")");
        	if (data.error === true && data.system === false) {
        		$.toast(data.error_msg);
        	} else if (data.error === true && data.login === false) {
        		//--
        	} else {
	        	if(typeof callback == "function") {
	        		callback(data);
	        	}
        	}
        },
        error: function(xhr, type) {
        	$.removeGifMask();
           // $.toast('网络错误!')
        }
	});
	return ajax;
}
